<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-model radio单选框</title>
  <script src="../js/vue.js"></script>
</head>
<body>
  <div id="app">
    <!-- input标签 radio属性 -->
    <!-- 在单选框被选中时，v-model绑定的数据属性被设置为单选框的value值 -->
    <!-- h5 添加了name属性实现了互斥 -->
    <label for="male">
        <input type="radio" id="male"  v-model="gender" value="男">男
    </label>
    <label for="female">
        <input type="radio" id="female" v-model="gender" value="女">女
    </label>
    <h2>{{gender}}</h2>
  </div>
<br>
  <script>
    let app = new Vue({
      el:"#app",
      data:{ 
        msg:'hello world',
        gender:'女' //设置默认值
      }
    })
  </script>
</body>
</html>